<template>
   <div class="after-sale-reason views-container">
        <div class="wlm-table">
            <div class="wlm-table-header">
                <!-- :model="tableFormatData.blessingBag.files" -->
            <el-form :model="tableFormatData.freeofCharge.files"  size="small" label-width="85px" class="retail-form" label-position="right">
                <el-form-item label="" class="filter">
                    <el-form-item label="订单编号：">
                        <el-input @keyup.enter.native="filesSerch" v-model="tableFormatData.freeofCharge.files.order_no" placeholder="请输入订单编号" style="width:160px;"></el-input>

                    </el-form-item>
                    <el-form-item label="用户昵称：">
                        <el-input @keyup.enter.native="filesSerch" v-model="tableFormatData.freeofCharge.files.nickName" placeholder="请输入用户昵称" style="width:160px;"></el-input>
                        
                    </el-form-item>
                </el-form-item>
                <el-form-item label="" class="filter-btns">
                    <el-button type="primary" @click="filesSerch">筛选</el-button>
                    <el-button type="text" @click="filesEmpty">清空筛选条件</el-button>
                </el-form-item>
            </el-form>
        </div>
                 <div class="wlm-table-content">
                    <el-table  :data="tableFormatData.freeofCharge.tableData" :ref="tableFormatData.freeofCharge.key" @selection-change="handleSelectionChange" style="width: 100%" >
                        <el-table-column prop="date" label="订单号" >
                            <template slot-scope="scope">
                                <span>{{scope.row.order_no}}</span>
                            </template>
                        </el-table-column>
                         <el-table-column prop="date" label="用户信息" >
                            <template slot-scope="scope">
                                 <div class="wlm-table-logos">
                                  <div style="display:flex;">
                                        <img
                                            class="logo"
                                            :src="scope.row.avatarUrl"
                                            >
                                         <div style="margin-left:10px;">
                                                <!-- <div style="font-size:12px">{{scope.row.user_id}}</div> -->
                                            <span style="font-size:12px">{{scope.row.nickName}}</span>
                                         </div>
                                  </div>
                                </div>
                            </template>
                        </el-table-column>
                          <el-table-column prop="date" label="商品信息" >
                            <template slot-scope="scope">
                                <span>{{scope.row.goods_name}}</span>
                            </template>
                        </el-table-column>
                          <el-table-column prop="date" label="购买数量" >
                            <template slot-scope="scope">
                                <span>{{scope.row.total_num}}</span>
                            </template>
                        </el-table-column>
                          <el-table-column prop="date" label="支付金额" >
                            <template slot-scope="scope">
                                {{scope.row.total_price}}
                            </template>
                        </el-table-column>
                          <el-table-column prop="date" label="订单状态" >
                            <template slot-scope="scope">
                                <span v-if="scope.row.pay_status==10">未付款</span>
                                <span v-if="scope.row.pay_status==20">已付款</span>
                            </template>
                        </el-table-column>
                          <el-table-column prop="date" label="下单时间" width="150">
                            <template slot-scope="scope">
                                <span>{{scope.row.create_time}}</span>
                            </template>
                        </el-table-column>
                          <el-table-column prop="date" label="返钱进度" >
                            <template slot-scope="scope">
                                {{scope.row.speed}}
                            </template>
                        </el-table-column>
                          <el-table-column prop="date" label="已返全额" >
                            <template slot-scope="scope">
                                {{scope.row.return_money}}
                            </template>
                        </el-table-column>
                         <el-table-column prop="date" label="被助力者订单号" width="200">
                            <template slot-scope="scope">
                                <div v-if="scope.row.pid_order_no">
                                      <router-link class="wlm-text" tag="span" :to="{path:'/application/freeoHelp', query:{order_id:scope.row.pid_order_id}}">
                                        <el-button type="text"> {{scope.row.pid_order_no}}</el-button>
                                     </router-link>
                                </div>
                                <div v-else>
                                    <span>-</span>
                                </div>
                                 
                               
                            </template>
                        </el-table-column>
                         <el-table-column prop="date" label="被助力者用户信息" width="150">
                            <template slot-scope="scope">
                                 <div class="wlm-table-logos">
                                  <div style="display:flex;">
                                        <img
                                            class="logo"
                                            v-if="scope.row.pid_avatarUrl"
                                            :src="scope.row.pid_avatarUrl|| ''"
                                            >
                                         <div style="margin-left:10px;">
                                                <!-- <div style="font-size:12px">{{scope.row.user_id}}</div> -->
                                            <span style="font-size:12px">{{scope.row.pid_nickName || '-'}}</span>
                                         </div>
                                  </div>
                                </div>
                            </template>
                        </el-table-column>
                         <el-table-column prop="date" label="帮助返佣" >
                            <template slot-scope="scope">
                                {{scope.row.pid_return_money || '-'}}
                            </template>
                        </el-table-column>
                          <el-table-column prop="date" label="操作" width="150">
                            <template slot-scope="scope">
                              <div class="operation-group">
                                 <router-link class="wlm-text" tag="span" :to="{path:'/orders/ordersVerificationManagementDetail', query:{order_id:scope.row.order_id,nickName:scope.row.nickName,user_id:scope.row.user_id}}">
                                        <el-button v-if="scope.row.is_goods==1" type="text">查看订单</el-button>
                                </router-link>
                                 <div class="btn-line" v-if="scope.row.is_goods==1"></div>
                                  <router-link class="wlm-text" tag="span" :to="{path:'/application/freeoHelp', query:{order_id:scope.row.order_id}}">
                                        <el-button type="text">助力详情</el-button>
                                </router-link>
                              </div>
                            </template>
                        </el-table-column>
                    </el-table>
                     <div class="pagination-content flex-row flex-justify-e flex-align-c">
          <el-pagination
            :disabled="!hasTableData"
            @size-change="listPageChange"
            @current-change="listPageChange"
            :current-page.sync="tableFormatData.freeofCharge.pagination.page"
            :page-sizes="tableFormatData.freeofCharge.pagination.pagesizes"
            :page-size.sync="tableFormatData.freeofCharge.pagination.list_rows"
            layout="total, sizes, prev, pager, next, jumper"
            :total="hasTableData?tableFormatData.freeofCharge.pagination.total : 0"
          >
          </el-pagination>
        </div>
                 </div>
        </div>
   </div>
</template>
<script>
import { getFreeOrder} from "@/api/freeofcharge";
import mixins from '@/mixins/mixins'
export default {
  mixins: [mixins.getters('Table')],
     name:'freeofCharge',
  data () {
    return {
      tableFormatData: {
                current: 'freeofCharge',
                freeofCharge: {
                key: 'freeofCharge',
                api: {
                    getList: getFreeOrder,
                    // delList: delFree
                },
                tableData: [],
                files: {
                    ids: [],
                    checkall: '0',
                    Recycle: '1',
                    order_no:'',
                    nickName:'',
                },
                //  rowId: 'free_id',
                pagination: {
                    page: 1,
                    list_rows: 10,
                    pagesizes: [10, 20, 50],
                    total: 0
                }
                }
            }
    }
  },
  methods: {
   
  }
}
</script>